#ifndef __USART_H
#define	__USART_H

#include "stm32f10x.h"
#include <stdio.h>


extern u8 UART1TimeOut;
extern u8 UART2TimeOut;
extern u8 UART3TimeOut;
extern uint8_t RS485sendFlag;


void Uart1Initial(uint32_t baud);
void Uart2Initial(uint32_t baud);
void Uart3Initial(uint32_t baud);

void USART1_SendByte(uint8_t *txdBuf, uint16_t len);
void USART2_SendByte(u16 len);

void dbg_printf( const char* str, ... );
uint16_t  user_uart_crc(uint8_t *pchMsg, uint16_t wDataLen);
void UART2SendIRQ(void );

void USART_SendByte( uint8_t USART_NUm , uint8_t *txdBuf,uint16_t len);
#ifdef Dbg_CTRL_FUN
#define Dbg_CTRL	dbg_printf
#else
#define Dbg_CTRL(...)
#endif

#ifdef Dbg_VOLT_FUN
#define Dbg_VOLT	dbg_printf
#else
#define Dbg_VOLT(...)
#endif
#ifdef Dbg_SOC_FUN
#define dbg_SOC	dbg_printf
#else
#define dbg_SOC(...)
#endif


#endif /* __USART_H */


